﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Repository.EntityFramework.Accounts
{
    /// <summary>表示一个账号信息
    /// </summary>
    public class AccountInfo //: AggregateRoot
    {
        public AccountInfo()
        {
            LastSignInTime = DateTime.Now;
            LastSignOutTime = DateTime.Now;
        }

        public DateTime CreatedOn { get; set; }
        public int Version { get; set; }

        /// <summary>账号ID
        /// </summary>
        [System.ComponentModel.DataAnnotations.Key]
        public string Id { get; set; }
        /// <summary>账号名
        /// </summary>
        [System.ComponentModel.DataAnnotations.Schema.Index("name", 1, IsUnique = true)]
        [System.ComponentModel.DataAnnotations.StringLength(128)]
        [System.ComponentModel.DataAnnotations.Required]
        public string Name { get; set; }
        /// <summary>账号密码
        /// </summary>
        [System.ComponentModel.DataAnnotations.StringLength(128)]
        [System.ComponentModel.DataAnnotations.Required]
        public string Password { get; set; }


        [System.ComponentModel.DataAnnotations.StringLength(128)]
        public string LastSessionId { get; set; }
        [System.ComponentModel.DataAnnotations.StringLength(15)]
        public string LastIpAddress { get; set; }
        public DateTime LastSignInTime { get; set; }
        public int TotalSignInTimes { get; set; }


        public DateTime LastSignOutTime { get; set; }
        public int TotalSignOutTimes { get; set; }
        


    }
}
